package com.codetype.web.blog.service.impl;

import com.codetype.web.blog.entity.SysAnnouncement;
import com.codetype.web.blog.mapper.SysAnnouncementMapper;
import com.codetype.web.blog.service.SysAnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysAnnouncementServiceImpl implements SysAnnouncementService {
        @Autowired
        private SysAnnouncementMapper sysAnnouncementMapper;
/**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_announcement
     * 删除
     *
     * @param sysId
     * @mbg.generated Sun Apr 10 10:40:31 CST 2022
 * @return
     */
    @Override
    public Boolean deleteByPrimaryKey(Integer sysId) {
        return this.sysAnnouncementMapper.deleteByPrimaryKey(sysId) > 0;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_announcement
     * 添加
     *
     * @param record
     * @mbg.generated Sun Apr 10 10:40:31 CST 2022
     * @return
     */
    @Override
    public Boolean insert(SysAnnouncement record) {
        return this.sysAnnouncementMapper.insert(record) > 0;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_announcement
     * 按照id查询
     *
     * @param sysId
     * @mbg.generated Sun Apr 10 10:40:31 CST 2022
     */
    @Override
    public SysAnnouncement selectByPrimaryKey(Integer sysId) {
        return this.sysAnnouncementMapper.selectByPrimaryKey(sysId);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_announcement
     * 查询所有
     *
     * @mbg.generated Sun Apr 10 10:40:31 CST 2022
     */
    @Override
    public List<SysAnnouncement> selectAll() {
        return sysAnnouncementMapper.selectAll();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_announcement
     * 更新数据
     *
     * @param record
     * @mbg.generated Sun Apr 10 10:40:31 CST 2022
     * @return
     */
    @Override
    public Boolean updateByPrimaryKey(SysAnnouncement record) {
        return this.sysAnnouncementMapper.updateByPrimaryKey(record) > 0;
    }
}
